Merged
Conversation
…native-multipart-upload
# Conflicts: # package/src/components/Attachment/__tests__/Attachment.test.tsx # package/src/components/Attachment/__tests__/Giphy.test.tsx
Contributor
SDK Size
|
# Conflicts: # package/src/components/Attachment/Attachment.tsx # package/src/components/Attachment/AttachmentFileUploadProgressIndicator.tsx # package/src/components/Attachment/AttachmentUploadIndicator.tsx # package/src/components/Attachment/CircularProgressIndicator.tsx # package/src/components/Attachment/FileAttachment.tsx # package/src/components/Attachment/Gallery.tsx # package/src/components/Attachment/VideoThumbnail.tsx # package/src/components/Attachment/__tests__/Attachment.test.tsx # package/src/components/Attachment/__tests__/Giphy.test.tsx # package/src/components/Channel/Channel.tsx # package/src/components/index.ts # package/src/hooks/usePendingAttachmentUpload.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Goal
This PR adds optional native multipart upload support for React Native and Expo packages, with native iOS/Android uploaders, a JS axios adapter, upload progress propagation and new attachment progress UI. Additionally, it also moves pending attachment uploads onto
client.uploadManager, adds local attachment id tracking, improves video/document attachment handling, and updates SampleApp to exercise the new native upload path.The reason why we decided to add an opt-in native upload is related to the fact that
axiosdoes not always report upload progress correctly on React Native, especially Android. It will sometimes either not update the progress at all or report it badly, causing UI glitches. Additionally, native uploads are much, much faster as we take advantage of streaming directly without any intermediate ephemeral files in order to do that. Finally,axioscan easily break if an override to the underlying RN'sfetchimplementation has been made, especially onAndroid.What Changed
StreamMultipartUploader, plus native handler registration throughstream-chat-react-nativeandstream-chat-expoinstallNativeMultipartAdapter/wrapAxiosAdapterWithNativeMultipartto route multipartFormDataaxios requests through the native uploader when available, while leaving non-multipart requests on the existing adapterChatsupport for enabling native multipart uploads viauseNativeMultipartUpload; SampleApp enables this pathclient.uploadManager.uploadby local attachment id instead of directly callingchannel.sendImage/channel.sendFilelocalIdpropagation from local attachments into message attachments so pending uploads can be correlated withclient.uploadManagerallowSendBeforeAttachmentsUploadrather than offline supportAttachmentUploadIndicator,CircularProgressIndicator, andMediaUploadProgressOverlayAndroidshared native source syncing to resolve shared native sources from the canonical project pathreact-native-fast-imagedependency with@d11/react-native-fast-image🛠 Implementation details
🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
developbranch